-- GENERATED SPELL FOR [Captain Skarloc] --


function spell0_17862(pUnit, Event) --@Cleanse,n/a--
pUnit:FullCastSpellOnTarget(29380,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17862', 840, 1)
end

function spell1_17862(pUnit, Event) --@Consecration,Self--
pUnit:FullCastSpellOnTarget(38385,pUnit)
pUnit:RegisterEvent('Sorts_17862', 20000, 1)
end

function spell2_17862(pUnit, Event) --@Devotion Aura,Self--
pUnit:FullCastSpellOnTarget(8258,pUnit)
pUnit:RegisterEvent('Sorts_17862', 813, 1)
end

function spell3_17862(pUnit, Event) --@Hammer of Justice,n/a--
pUnit:FullCastSpellOnTarget(13005,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17862', 6419, 1)
end

function spell4_17862(pUnit, Event) --@Holy Light,Heal--
pUnit:FullCastSpellOnTarget(29427,pUnit)
pUnit:RegisterEvent('Sorts_17862', 2500, 1)
end

function spell5_17862(pUnit, Event) --@Holy Shield,Self--
pUnit:FullCastSpellOnTarget(31904,pUnit)
pUnit:RegisterEvent('Sorts_17862', 8436, 1)
end

function Sorts_17862(pUnit, Event)
local choix_sorts_17862 = math.random(0, 5)
if choix_sorts_17862 == 0 then
pUnit:RegisterEvent('spell0_17862', 1, 1)
end
if choix_sorts_17862 == 1 then
pUnit:RegisterEvent('spell1_17862', 1, 1)
end
if choix_sorts_17862 == 2 then
pUnit:RegisterEvent('spell2_17862', 1, 1)
end
if choix_sorts_17862 == 3 then
pUnit:RegisterEvent('spell3_17862', 1, 1)
end
if choix_sorts_17862 == 4 then
pUnit:RegisterEvent('spell4_17862', 1, 1)
end
if choix_sorts_17862 == 5 then
pUnit:RegisterEvent('spell5_17862', 1, 1)
end
end

function mob17862_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17862', math.random(1500, 3000), 1)
end

function mob17862_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17862_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17862_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17862, 1, 'mob17862_Action')
RegisterUnitEvent(17862, 2, 'mob17862_Leave')
RegisterUnitEvent(17862, 3, 'mob17862_Kill')
RegisterUnitEvent(17862, 4, 'mob17862_Die')
